<#include "../base.ftl"/>

<#macro title>
    字典管理
</#macro>

<#macro cssfile>
</#macro>

<#macro scriptfile>
</#macro>

<#macro breadcrumb>
    <ul class="breadcrumb">
     <li><a href="index.html">Home</a> <span class="divider">/</span></li>
     <li class="active">字典管理</li>
    </ul>
</#macro>

<#macro main>
    <table id="gridTable"></table>
    <div id="gridPager"></div>
</#macro>

<#macro jsscript>
    jQuery(document)  
        .ready(  
                function() {  
                    jQuery("#gridTable")  
                            .jqGrid(  
                                    {  
                                        url : 'list/admin/dictClass/list.html',  
                                        editurl : 'operator/data/TDictionaryClass/operator.html',  
                                        datatype : "json",  
                                        mtype : 'POST',  
                                        height : 400,  
                                        colNames : [ "ID","大类名称","大类编码" ],  
                                        colModel : [ {  
                                            name : 'dictclassId',  
                                            jsonmap : 'DICTCLASS_ID',  
                                            index : 'DICTCLASS_ID',  
                                            hidden: true,  
                                            editable: false,  
                                            search : false  
                                        },{  
                                            name : 'dictclassName',  
                                            jsonmap : 'DICTCLASS_NAME',  
                                            index : 'DICTCLASS_NAME',  
                                            editable: true,  
                                            searchoptions : { sopt : [ "eq", "cn" ] },    search : true  
                                        },{  
                                            name : 'dictclassCode',  
                                            jsonmap : 'DICTCLASS_CODE',  
                                            index : 'DICTCLASS_CODE',  
                                            editable: true,  
                                            searchoptions : { sopt : [ "eq", "cn" ] },    search : true  
                                        } ],  
                                        sortname : 'DICTCLASS_NAME',  
                                        sortorder : 'asc',  
                                        viewrecords : true,  
                                        gridview : true,  
                                        autowidth : true,  
                                        rowNum : 20,  
                                        rowList : [ 10, 20, 30 ],  
                                        pager : jQuery('#gridPager'),  
                                        jsonReader : {  
                                            page : "page.pageNo",  
                                            total : "page.totalPages",  
                                            records : "page.totalCount",  
                                            root : "page.result",  
                                            repeatitems : false,  
                                            id : 'DICTCLASS_ID'  
                                        },      
                                        prmNames : {  
                                            rows : "page.pageSize",  
                                            page : "page.pageNo",  
                                            sort : "page.orderBy",  
                                            order : "page.order"  
                                        },  
                                        pager : "#gridPager",  
                                        caption : "字典大类"  
                                        }).navGrid('#gridPager', {  
                                            edit : true,  
                                            add : true,  
                                            del : true,  
                                            search : true  
                                        }, {  
                                                //edit  
                                                beforeShowForm : function(form) {  
                                                },  
                                                reloadAfterSubmit : true,  
                                                closeAfterEdit : true, //修改完毕后关闭  
                                                afterComplete : opertaionPrompt,
                                                onclickSubmit : setAppendParam
                                            }, {  
                                                //add  
                                                beforeShowForm : function(form) {  
                                                },  
                                                reloadAfterSubmit : true,  
                                                closeAfterAdd : true, //新增完毕后关闭  
                                                afterComplete : opertaionPrompt,
                                                onclickSubmit : setAppendParam  
                                            }, {  
                                                //del  
                                                reloadAfterSubmit : true,  
                                                afterComplete : opertaionPrompt  
                                            }, {  
                                                //组合查询  
                                                multipleSearch : true  
                                            });  
                                            
                                            function setAppendParam(params,postdata){
                                                var add_data = new Object();
                                                add_data["projectId"] = "el:currProject";
                                                return add_data;
                                            }
                                        });  
</#macro>